package com.suanfa;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author jukg
 * @date 2024/12/19 15:11
 * @description
 */
public class Test {

    public static void main1(String[] args) {
        System.out.println(getPoint("babab"));
    }

    public static long getPoint(String str) {
        long total = 0;
        if (str == null) return 0;
        if (str.length() == 1) {
            total = total + 1;
        } else {
            for (int i = 0; i < str.length(); i++) {
                String s = str.substring(str.length() - 1 - i, str.length());
                int t =0;
                for(int j =1; j<= s.length(); j++){
                    String st = s.substring(0, j);
                    if(str.startsWith(st)){
                        t = st.length();
                        continue;
                    }
                    break;
                }
                total +=t;
            }
        }
        return total;

    }

    public static void main(String[] args) {
        for(int i=1; i<5; i++) {
            test1();
            test2();
        }
    }

    static void  test1(){
        System.out.println("test1");
        return;
    }

    static  void test2(){
        System.out.println("test2");
    }



}
